<template>
  <el-dialog
    v-model="dialogVisible"
    :title="dialogTitle"
    width="500"
  >
    <div style="display: flex;">
      <div style="margin-right: 10px;">{{ dataForm.name }}</div>
      <div style="margin-right: 10px;">{{ dataForm.securities_name }}</div>
      <div style="margin-right: 10px;">{{ dataForm.account_id }}</div>
    </div>
    <div>密钥：{{ dataForm.secret_key }}</div>
  </el-dialog>
</template>

<script lang="ts" setup>
import { ref, reactive } from 'vue'
import { ElMessageBox } from 'element-plus'
const dialogVisible = ref(false)
const dialogTitle = ref()
let dataForm = reactive({
  name: null,
  account_id: null,
  securities_name: null,
  tradable_sectors: [],
  buy_ratio: null,
  status: '1',
  secret_key: null
})
const view = (data) => {
  dialogVisible.value = true
  dialogTitle.value = data.title
  dataForm = reactive({...data.form})
}
// 暴露给父组件方法
defineExpose({
  view
});
</script>